<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="login_form">
        <span class="light"></span><span class="light"></span><span class="light"></span><span class="light"></span>
    </div>
    <div class="cardBox"> 边框流光闪烁阴影效果 </div>
</body>

</html>

<style>
    .login_form {
        position: absolute;
        width: 100px;
        height: 100px;
        margin-left: 600px;
        overflow: hidden;
        background: #191c29;
    }

    .light {
        position: absolute;
        display: block;
    }

    .light:nth-child(1) {
        top: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background: linear-gradient(90deg, transparent, #3a86ff);
        animation: animate1 8s linear infinite;
    }

    @keyframes animate1 {
        0% {
            left: -100%;
        }

        50%,
        100% {
            left: 100%;
        }
    }

    .light:nth-child(2) {
        top: -100%;
        right: 0;
        width: 3px;
        height: 100%;
        background: linear-gradient(180deg, transparent, #3a86ff);
        animation: animate2 8s linear infinite;
        animation-delay: 2s;
    }

    @keyframes animate2 {
        0% {
            top: -100%;
        }

        50%,
        100% {
            top: 100%;
        }
    }

    .light:nth-child(3) {
        bottom: 0;
        right: 0;
        width: 100%;
        background: linear-gradient(270deg, transparent, #3a86ff);
        animation: animate3 8s linear infinite;
        animation-delay: 4s;
    }

    @keyframes animate3 {
        0% {
            right: -100%;
            height: 3px;
        }

        50%,
        100% {
            height: 2px;
            right: 100%;
        }
    }

    .light:nth-child(4) {
        bottom: -100%;
        left: 0;
        width: 3px;
        height: 100%;
        background: linear-gradient(360deg, transparent, #3a86ff);
        animation: animate4 8s linear infinite;
        animation-delay: 6s;
    }

    @keyframes animate4 {
        0% {
            bottom: -100%;
        }

        50%,
        100% {
            bottom: 100%;
        }
    }
</style>

<style>
    @property --rotate {
        syntax: "<angle>";
        initial-value: 132deg;
        inherits: false;
    }

    :root {
        --card-height: 65vh;
        --card-width: calc(var(--card-height) / 1.5);
    }

    body {
        min-height: 100vh;
        background: #212534;
        display: flex;
        align-items: center;
        flex-direction: column;
        padding-top: 2rem;
        padding-bottom: 2rem;
        box-sizing: border-box;
    }

    .cardBox {
        background: #191c29;
        width: var(--card-width);
        height: var(--card-height);
        padding: 3px;
        position: relative;
        border-radius: 6px;
        justify-content: center;
        align-items: center;
        text-align: center;
        display: flex;
        font-size: 1.5em;
        color: rgb(88 199 250 / 0%);
        cursor: pointer;
        font-family: cursive;
    }

    .cardBox:hover {
        color: rgb(88 199 250 / 100%);
        transition: color 1s;
    }

    .cardBox:hover:before,
    .cardBox:hover:after {
        animation: none;
        opacity: 0;
    }

    /* 环绕彩色线条 */

    .cardBox::before {
        content: "";
        width: 104%;
        height: 102%;
        border-radius: 8px;
        background-image: linear-gradient(var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2);
        position: absolute;
        z-index: -1;
        top: -1%;
        left: -2%;
        animation: spin 2.5s linear infinite;
    }

    /* 荧光 */

    .cardBox::after {
        position: absolute;
        content: "";
        top: calc(var(--card-height) / 6);
        left: 0;
        right: 0;
        z-index: -1;
        height: 100%;
        width: 100%;
        margin: 0 auto;
        transform: scale(0.8);
        filter: blur(calc(var(--card-height) / 6));
        background-image: linear-gradient(var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2);
        opacity: 1;
        transition: opacity .5s;
        animation: spin 2.5s linear infinite;
    }

    @keyframes spin {
        0% {
            --rotate: 0deg;
        }

        100% {
            --rotate: 360deg;
        }
    }
</style>